package com.snail.xgcd;

import com.snail.xgcd.utils.id.IdWorkerBuider;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.snail.xgcd.mapper")
public class XgcdApplication {

    public static void main(String[] args) {
        IdWorkerBuider.IDWORKER.build();
        SpringApplication.run(XgcdApplication.class, args);

//        sort();
    }

    public static void sort (){
        int [] arr = {1,5,4,7,6,8,2,3,9,0};

        System.out.println("排序前的组是:");
        for(int num:arr){
            System.out.print("  "+num);
        }
        for(int i= 0;i<arr.length;i++){
            for(int j=0;j<arr.length-1-i;j++){
                if(arr[j]>arr[j+1]){
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
        System.out.println("排序后的组是:");
        for(int num:arr){
            System.out.print("  "+num);
        }

//        System.out.println("排序前数组为：");
//        for (int num : arr) {
//            System.out.print(num + " ");
//        }
//        for (int i = 0; i < arr.length - 1; i++) {//外层循环控制排序趟数
//            for (int j = 0; j < arr.length - 1 - i; j++) {//内层循环控制每一趟排序多少次
//                if (arr[j] > arr[j + 1]) {
//                    int temp = arr[j];
//                    arr[j] = arr[j + 1];
//                    arr[j + 1] = temp;
//                }
//            }
//        }
//        System.out.println();
//        System.out.println("排序后的数组为：");
//        for (int num : arr) {
//            System.out.print(num + " ");
//        }

    }
}

